<!doctype html>
<html>
    <head>
        <title>添加新记录</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <link rel="stylesheet" href="__PUBLIC__/User/css/weui.css"/>
        <link rel="stylesheet" href="__PUBLIC__/User/css/example.css"/>
        <script src="__PUBLIC__/User/js/jquery.js"></script>
        <link rel="stylesheet" href="__PUBLIC__/User/css/swiper.min.css">
        <script src="<?php echo $dic;?>"></script>
        <script src="<?php echo $pro;?>"></script>
        <!-- 二次定义weui样式开始 -->
        <style>
            . .weui-cell__hd{
                width:40%;
                padding:0px;
            }
            .weui-cell{
                width:60%;
            }
            .weui-cell_vcode{
                width:100%;
            }
            .weui-label{
                width:140px;
                overflow: hidden;
            }
            .operation_div,.operation_div_2{
                padding:18px;
            }
            .weui-input{
                padding-left:20px;
            }
            .operation_div_2 input{
                width:23%;
                margin-right: 2%;
                display: inline;
            }
        </style>
        <!-- 二次定义weui样式结束 -->
        <script src="__PUBLIC__/User/js/dom_tool.js"></script>
        <script>
            $(function(){
                 var json = eval(<?php echo $sublist;?>);
                 var data = {
                    name:json.name,
                    action:'__MODULE__/Info/addok',
                    method:'post',
                    json:json.sublist,
                    dic:dic,
                    pro_dic:pro_dic
                 }; 
                 addNew(data);
                 //检测表单提交数据合法性
                 $('form').bind('submit',function(){
                	//初始化判断标记
                	var flag = true;
                	$('select').each(function(){
                		if($(this).val()=='请选择'){
                			$('#dialog2').show();
                			$('#dialog2_msg').html($(this).parent().prev().find('label').html()+'必选!');
                			flag = false;
                			return;
                		}
                	});
                	if(flag){
                		return true;
                	}else{
                		return false;
                	}
                })
                //点击取消按钮隐藏alert提示
                $('#dialog2_but').bind('click',function(){
                	$('#dialog2').hide();
                });
            });
            
            $(function(){
                $('.callback_button').bind('click',function(){
                    history.go(-1);
                })
            });
        </script>
    </head>
    <body>
		<div id="dialog2" style="display:none;">
		<div class="weui-mask"></div>
			<div class="weui-dialog">
				<div class="weui-dialog__hd"><strong class="weui-dialog__title">操作提示</strong></div>
				<div class="weui-dialog__bd" id="dialog2_msg">
				</div>
				<div class="weui-dialog__ft">
				<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" id="dialog2_but">好的</a>
				</div>
			</div>
		</div>
		</div>
    </body>
</html>